// pages/my/my.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    year:new Date().getFullYear(),
    month:new Date().getMonth()+1,
    userInfo:{},
    taskReport:{}
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onShow(options) {
    this.getUserInfo()
    this.getTaskReport()
  },
  async getUserInfo(){
    const res = await wx.http.get('/driver/users')
    this.setData({userInfo:res})
  },
  async getTaskReport(){
    const taskReport = await wx.http.get('/driver/users/taskReport',{year:this.data.year,month:this.data.month}) 
    this.setData({taskReport})
  }
})